package demo;

public class SleepDemo2_2 {
    public static void main(String[] args) {
        Thread lin = new Thread(){
            public void run(){
                System.out.println("lin:刚美完容睡一觉");
                try {
                    Thread.sleep(5555555);
                } catch (InterruptedException e) {
                    System.out.println("lin:干嘛呢干嘛呢都破了相了!");
                }
                System.out.println("lin:醒了!");
            }
        };
        Thread huang = new Thread(){
            public void run(){
                System.out.println("huang:大锤八十!.小锤四十!");
                for (int i = 0; i < 5; i++) {
                    System.out.println("huang:八十");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println("huang:咣当!");
                System.out.println("huang:大哥!搞定");
                lin.interrupt();

            }
        };
        lin.start();
        huang.start();
    }
}
